<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
			<script type="text/javascript" src="js/jquery-1.11.1.min.js" ></script>
		    <script type="text/javascript" src="js/template.js" ></script>
		
	</head>
	<body>
		
		<table id="table1"></table>
		<script id="template1" type="text/html" >
			{{if isAdmin}}
			<tr>
				{{each list as user i}}
		       		<td>{{i+1}}:{{user}}</td>
		        {{/each}}
		    </tr>
		   
		    {{/if}}
		</script>
		
		<script type="text/javascript">
			 /*var users = [
	        {
	            id: 'think8848',
	            name: 'Joseph Chan',
	            
	        },
	        {
	            id: 'aCloud',
	            name: 'Mary Cheung',
	        }
	    ];*/
	   
	    var data = {
		title: '基本例子',
		isAdmin: true,
		list: ['文艺', '博客', '摄影', '电影', '民谣', '旅行', '吉他']
	};
	   
	   
	    var html = template('template1',data);
	    $("#table1").html(html);
		</script>
	
		
		
	</body>
</html>
